'''
字符串，整型，浮点型之间的类型转换
格式：
    1、整型    int(变量)
    2、浮点型    float(变量)
    3、字符串类型    str(变量)

'''
from importlib.util import source_hash

# 字符串类型
num1 = '10'
num2 = '20'

result = num1 + num2
print(f'result = {result}')
print(f'type(result) = {type(result)}')

n1 = int(num1)
n2 = int(num2)

result = n1 + n2
print(f'result = {result}')
# result = 30
print(f'type(result) = {type(result)}')
# type(result) = <class 'int'>

# int(str + str)
result = int(num1 + num2)
print(f'result = {result}')
# result = 1020
print(f'type(result) = {type(result)}')
# type(result) = <class 'int'>

# int -> float
f1 = float(n1)
print(f'f1 = {f1}')
# f1 = 10.0
print(f'type(f1) = {type(f1)}')
# type(f1) = <class 'float'>